<?php

use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */

echo "<?php\n";
?>

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->searchModelClass, '\\') ?> */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="box-header">
    <div class="container-fluid">
        <div class="row">
            <?= "<?php " ?>$form = ActiveForm::begin([
                'id'=>'form-search',
                'action' => ['index'],
                'method' => 'get',
            <?php if ($generator->enablePjax): ?>
                'options' => [
                'data-pjax' => 1
                ],
            <?php endif; ?>
]); ?>
    <?php
    $count = 0;
    foreach ($generator->getColumnNames() as $attribute) {
        if (++$count < 6) {
            echo "      <?= " . $generator->generateActiveSearchField($attribute) . " ?>\n\n\t";
        } else {
            echo "      <?php // echo " . $generator->generateActiveSearchField($attribute) . " ?>\n\n\t";
        }
    }
    ?>
    <div class="form-group">
        <?= "<?= " ?>Html::submitButton('<span class="fa fa-search"> 搜索</span>', ['class' => 'btn btn-primary']) ?>
        <?= "<?= " ?>Html::resetButton('<span class="fa fa-refresh"> 重置</span>', ['class' => 'btn btn-default']) ?>
        <div class="help-block"></div>
    </div>
            <?= "<?php " ?>ActiveForm::end(); ?>
        </div>
    </div>
</div>
